package cn.valo.basic.util;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class AjaxResult {

    public Boolean success = true;

    public String msg = "操作成功!";
    public Object resultObj;

    public AjaxResult setSuccess(Boolean success) {
        this.success = success;
        return this;
    }

    public AjaxResult setMsg(String msg) {
        this.msg = msg;
        return this;
    }
    public AjaxResult setResultObj(Object obj){
        this.resultObj=obj;
        return this;
    }
    public static AjaxResult success(){
        return new AjaxResult();
    }

    public static AjaxResult error(){
        return new AjaxResult().setSuccess(false).setMsg("系统繁忙，请重试!");
    }
}